import {
  Controller,
  Get,
  Post,
  Body,
  Query,
  Header,
  UseGuards,
  Request,
} from '@nestjs/common';
import { FieldService } from './field.service';
import { AuthGuard } from '@nestjs/passport';

@UseGuards(AuthGuard('jwt'))
@Controller('field')
export class FieldController {
  constructor(private readonly fieldService: FieldService) {}
  //保存创建角色
  @Post('/saveField')
  async saveField(@Body() param) {
    return await this.fieldService.saveField(param);
  }
  @Post('/saveFieldList')
  async saveFieldList(@Body() param) {
    return await this.fieldService.saveFieldList(param);
  }
  //查询角色
  @Get('/getField')
  async getField(@Query() param) {    
    return await this.fieldService.getField(param);
  }
  //查询角色列表
  @Post('/getFieldList')
  async getFieldList(@Body() param) {
    return await this.fieldService.getFieldList(param);
  }
  //批量删除角色
  @Post('/delFieldList')
  async delFieldList(@Body() param) {
    return await this.fieldService.delFieldList(param);
  }
}
